package ru.spb.osll.myfit.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import ru.spb.osll.myfit.fixtures.base.DummyOneLineFixture;
import ru.spb.osll.myfit.fixtures.base.OneLineFixture;
import fit.Fixture;

public class ReflectionUtilsTest {
	@Test
	public void testPrimitiveTypeWrappersMap() {
		assertEquals(Boolean.class, ReflectionUtils.primitiveTypeWrappersMap
				.get(boolean.class));
		assertEquals(Integer.class, ReflectionUtils.primitiveTypeWrappersMap
				.get(int.class));
	}

	@Test
	public void testGetClassHierarhy() {
		assertTrue(ReflectionUtils.getClassHierarhy(DummyOneLineFixture.class)
				.containsAll(
						CollectionUtils.list(Object.class.getName(),
								Fixture.class.getName(), OneLineFixture.class
										.getName(), DummyOneLineFixture.class
										.getName())));
		assertTrue(ReflectionUtils.getClassHierarhy(Object.class).containsAll(
				CollectionUtils.list(Object.class.getName())));
	}
}
